import request from '@/utils/request'
//  获取部门列表
export function getDepartments () {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 删除部门接口

export function delDepartments (id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

//新增部门
export function addDepartments (data) {
  return request({
    url: `/company/department`,
    method: 'post',
    data
  })
}
//根据id查询部门详情
export function getDeptdetails (id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
// 编辑部门
export function editDepartments (data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
